#include <iostream>

using namespace std;

int main()
{
    int array[1000];

    for (int i = 2; i < 1000; ++i)
    {
        if (!array[i]) 
        {
            cout << i << " ";
            int foo = i;
            while (foo < 1000)
            {
                if (!(foo % i)) array[foo] = 1;
                foo++;
            }
        }
    }

    cout << endl;

    return 0;
}

